www.gusucode.com > 惯性导航系统仿真程序 SIMULINK环境-SIMULINK源码程序 > code/matlab 6.5和7.0的兼容问题.txt

    matlab 6.5和7.0的兼容问题
分类: Technology  |  标签:  matlab 
mdl文件在6.5里面做的,但是到了7.0里面却打不开,下面就是相关信息:Warning: Unable to load model file 'd:\Program Files\MATLAB704\work\******.mdl' due to the presence of characters that are not supported in the current character encoding setting 'ibm-1386_P100-2002'. Either: 

1) run "bdclose all; set_param(0,'CharacterEncoding', Enc)" where Enc is one of windows-1252, ISO-8859-1, then load the model, or

2) remove the unsupported characters. The first such character occurs on line 170, byte offset 23.

解决方法:

bdclose all;

set_param(0,'CharacterEncoding','windows-1252') 

这是因为存在中文字符造成的

解决的办法 

(1)在工作空间中输入下列命令,然后打开 

bdclose all; 

Enc='windows-1252'; 

set_param(0,'CharacterEncoding',Enc); 

or 

set_param(0,'CharacterEncoding','windows-1252'); 

(2)在工作空间中输入下列命令,然后打开 

bdclose all 

set_param(0, 'CharacterEncoding', 'ISO-8859-1') 

同样如果要在7.0的模型里用中文注释,然后保存,就需要 

set_param('ModelName', 'SavedCharacterEncoding', 'ISO-8859-1') 

这里ModelName是你的mdl模型名,而且必须被打开了。